/**
 * QM Controller层
 */
app.controller('qmCtrl', function ($scope, qmService, $timeout) {
    var msgBox = null;
    function findAllQM(){
        qmService.findAllQM({
            action: 'findAllQM'
        },function(data){
            if(data.state == 'SUCCESS'){
                $scope.qmList = data.data.qmVO;
            }else{
                if(msgBox == null){
                    msgBox = bootbox.alert(data.reason,function(){
                        msgBox = null;
                    });
                }
            }
        });
        $timeout(function(){
            findAllQM();
        },$scope.selectTime);
    }
    findAllQM();
    $scope.changeTime = function (time) {
        $scope.selectTime = time;
    };
});

